<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <script type="text/javascript">
    	$(function(){
    		var obj=$("#ta").datagrid("getSelections");
    		$("#application").form('load',{
    			drugid:obj[0].drugid,
    			drugname:obj[0].drugname,
    			providerid:obj[0].proname,
    			drugnum:obj[0].drugnum,
    		});
    	});
    	function subform(){
    		$.post("Warehouse/application",$("#application").serialize(),function(data){
    			if(data.state==200){
    				$.messager.alert('提示','提交成功，请静心等待');
    				$("#d").window("close");
    				$("#ta").datagrid("reload");
    			}else{
    				$.messager.alert('提示','提交失败');
    			}
    		});
    	}
    	function clearForm(){
        	$("#application").form("load",{
        	    drugid:"",
        	   	drugname:"",
        	   	providerid:"",
        	    drugnum:""
        	}) 
        }
    </script>
<form id="application">
	<table align="center" width="60%" >
			<tr >
				<td>药品名称</td>
				<td>
					<input class="easyui-textbox" type="text" name="drugname" data-options="required:true,editable:false">
				</td>
			</tr>
			<tr>
				<td>生产商</td>
				<td>
					<input class="easyui-textbox" type="text" name="providerid" data-options="required:true,editable:false">
				</td>
			</tr>
			<tr>
				<td>药品库存</td>
				<td>
					<input class="easyui-textbox" type="text" name="drugnum" data-options="required:true,editable:false">
				</td>
			</tr>
			<tr>
				<td>申请说明</td>
				<td>
					<textarea id="conditionId" name="logcontent" class="easyui-validatebox" data-options="required:true" style="width: 199px; height: 60px;">
					</textarea>
				</td>
			</tr>
			<tr>
				<td>申请数量</td>
				<td>
					<input class="easyui-textbox" type="text" name="applicationnum" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td>申请人</td>
				<td>
					<input class="easyui-textbox" type="text" name="applicationname" data-options="required:true">
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					  <a href="javascript:void(0)" class="easyui-linkbutton" onclick="subform()" data-options="iconCls:'icon-ok'">提交</a>
				</td>
			</tr>
		</table>
</form>